From 87456099ffee2db3bf53ab51ec82fb43608aacab Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 19 Feb 2009 04:23:32 +0000 Subject: [PATCH] (detect_coding): Don't overflow coding->carryover. --- src/coding.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/coding.c b/src/coding.c index ec57467f023..313e4021486 100644 --- a/src/coding.c +++ b/src/coding.c @@ -6805,6 +6805,8 @@ decode_coding (coding) coding->carryover. */ unsigned char *p = coding->carryover; + if (nbytes > sizeof coding->carryover) + nbytes = sizeof coding->carryover; coding->carryover_bytes = nbytes; while (nbytes-- > 0) *p++ = *src++; -- 2.30.2